package kin.interceptor.system;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;



import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

public class PaggingInterceptor extends HandlerInterceptorAdapter{

	@Override
	public boolean preHandle(HttpServletRequest request,
			HttpServletResponse response, Object handler) {
		String cp="";
		System.out.println("fffsss");
		/*if(""!=cp&&null!=cp){
		int currentPage=Integer.parseInt(cp);
		
		String ps=request.getParameter("pageSize");
		int pageSize=Integer.parseInt(ps);
		String  isPagging=request.getParameter("pageSize");
		if(Boolean.valueOf(isPagging)){
		if(currentPage==0){
			currentPage=1;
		}
		if(pageSize==0){
			pageSize=25;
		}
		SystemContext.setCurrentPage(currentPage);
		SystemContext.setPagesize(pageSize);
		}
		}*/
		
		return false;
	}

	@Override
	public void postHandle(HttpServletRequest request,
			HttpServletResponse response, Object handler,
			ModelAndView modelAndView) throws Exception {
		// TODO Auto-generated method stub
		super.postHandle(request, response, handler, modelAndView);
	}

	@Override
	public void afterCompletion(HttpServletRequest request,
			HttpServletResponse response, Object handler, Exception ex)
			throws Exception {
		// TODO Auto-generated method stub
		super.afterCompletion(request, response, handler, ex);
	}

	@Override
	public void afterConcurrentHandlingStarted(HttpServletRequest request,
			HttpServletResponse response, Object handler) throws Exception {
		System.out.println("PropertyInterceptor.afterConcurrentHandlingStarted()");
		super.afterConcurrentHandlingStarted(request, response, handler);
	}

}
